home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
existdir.zip
/
CHKXPATH.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-05-20
|
1KB
|
36 lines
@echo off
if exist *.$X$ del *.$X$
if "%1"=="" goto help
if not exist %1 goto no_file
rem>FILE.$X$
goto end
:no_file
if exist %1\chkxpath.nul goto subdir
ctty nul
rem>%1\chkxpath.nul
ctty con
if not exist %1\chkxpath.nul goto no_subdir
del %1\chkxpath.nul >nul
:subdir
if exist %1\*.* goto fill-dir
rem>EMPTYDIR.$X$
goto end
:fill-dir
rem>FILL-DIR.$X$
goto end
:no_subdir
rem>NONE.$X$
goto end
:help
echo CHKXPATH by Jim Groeneveld, NL, 20/5-92.
echo Checks existence (or not) of some name as a disk file or subdirectory.
echo Syntax: CHKXPATH name
echo in which 'name' may be any combination of drive:path without trailing '\'.
echo To check a root dir of some drive use '\.' or 'd:\.' .
echo Output: one of the following zero-length files in the current subdir:
echo FILE.$X$ if 'name' exists as a FILE
echo FILL-DIR.$X$ if 'name' exists as a NON-EMPTY (SUB)DIR
echo EMPTYDIR.$X$ if 'name' exists as an EMPTY (SUB)DIR
echo NONE.$X$ if 'name' does NOT exist
:end